import 'package:flutter/material.dart';
import 'package:miapp/jsFramework/jsWidget/utils/tools.dart';

class JsonWidget extends StatelessWidget {
  final Map json;
  JsonWidget({@required this.json});
  @override
  Widget build(BuildContext context) {
    switch (json["tag"]) {
      case "Container":
        Map _attr = json["attr"];
        return Container(
          width: double.parse("${_attr["width"]}"),
          height: double.parse("${_attr["height"]}"),
          decoration: BoxDecoration(
            color:  Tools.toColor(_attr["color"]),
          ),
        );
        break;
      default:
        return Container();
    }
  }
}
